<?php
require_once './component/head.php';
if (!isset($_SESSION['uid'])) header('Location:./login.php');
require_once './component/drawer.php';
require_once './function/conn.php';
$info = GetInfoById($_SESSION['uid']);
$uid = $info['Id'];
$uname = $info['Name'];
$uemail = $info['Email'];
$udate = $info['Date'];
$uage = $info['Age'];
$usex = $info['Sex'];
$utel = $info['Tel'];
$ucollege = $info['College'];
$usign = $info['Signature'];
?>
<script type="text/javascript">
    window.onload = function () {
        SettingsOnload();
    };
</script>
<div id="user_info" class="mdui-container mdui-center">
    <div class="mdui-chip">
        <span class="mdui-chip-title mdui-text-color-theme-accent">基础资料</span>
    </div>
    <div class="mdui-card mdui-center" style="margin-top: 5px">
        <!-- 卡片头部，包含头像、标题、副标题 -->
        <div class="mdui-card-header">
            <img class="mdui-card-header-avatar" src="./src/img/picture.jpg" alt="头像"/>
            <div class="mdui-card-header-title"><?php echo $uname; ?></div>
            <div class="mdui-card-header-subtitle">
                <?php
                if (strlen($usign) > 45) echo substr($usign, 0, 45) . '...';
                else echo $usign;
                ?>&nbsp;
            </div>
        </div>
        <div class="mdui-divider"></div>
        <div class="mdui-list">
            <div id="setting_id" class="mdui-list-item mdui-ripple">
                <i class="mdui-list-item-icon mdui-icon material-icons">&#xe7fd;</i>
                <div class="mdui-list-item-content">用户Id</div>
                <div class="mdui-list-item-content mdui-text-right"><?php echo $uid; ?>&nbsp;</div>
            </div>
            <div class="mdui-divider mdui-m-y-0"></div>
            <div id="setting_name" class="mdui-list-item mdui-ripple">
                <i class="mdui-list-item-icon mdui-icon material-icons">&#xe24c;</i>
                <div class="mdui-list-item-content">姓名</div>
                <div class="mdui-list-item-content mdui-text-right"><?php echo $uname; ?>&nbsp;</div>
                <i class="mdui-icon material-icons">&#xe315;</i>
            </div>
            <div class="mdui-divider mdui-m-y-0"></div>
            <div id="setting_email" class="mdui-list-item mdui-ripple">
                <i class="mdui-list-item-icon mdui-icon material-icons">&#xe0be;</i>
                <div class="mdui-list-item-content">电子邮件</div>
                <div class="mdui-list-item-content mdui-text-right"><?php echo $uemail; ?>&nbsp;</div>
                <i class="mdui-icon material-icons">&#xe315;</i>
            </div>
            <div class="mdui-divider mdui-m-y-0"></div>
            <div id="setting_date" class="mdui-list-item mdui-ripple">
                <i class="mdui-list-item-icon mdui-icon material-icons">&#xe916;</i>
                <div class="mdui-list-item-content">注册日期</div>
                <div class="mdui-list-item-content mdui-text-right"><?php echo $udate; ?>&nbsp;</div>
            </div>
            <div class="mdui-divider mdui-m-y-0"></div>
            <div class="mdui-list-item mdui-ripple">
                <i class="mdui-list-item-icon mdui-icon material-icons">&#xe90d;</i>
                <div class="mdui-list-item-content">用户类型</div>
                <div class="mdui-list-item-content mdui-text-right"><?php echo $_SESSION['utype']; ?>&nbsp;</div>
            </div>
        </div>
    </div>
    <div class="mdui-chip">
        <span class="mdui-chip-title mdui-text-color-theme-accent">更多信息</span>
    </div>
    <div class="mdui-card mdui-center" style="margin-top: 5px">
        <div class="mdui-list">
            <div id="setting_sign" class="mdui-list-item mdui-ripple">
                <i class="mdui-list-item-icon mdui-icon material-icons">&#xe150;</i>
                <div class="mdui-list-item-content">个性签名</div>
                <div class="mdui-list-item-content mdui-text-right">
                    <?php
                    if (strlen($usign) > 39) echo substr($usign, 0, 39) . '...';
                    else echo $usign;
                    ?>&nbsp;
                </div>
                <i class="mdui-icon material-icons">&#xe315;</i>
            </div>
            <div class="mdui-divider mdui-m-y-0"></div>
            <div id="setting_age" class="mdui-list-item mdui-ripple">
                <i class="mdui-list-item-icon mdui-icon material-icons">&#xe84e;</i>
                <div class="mdui-list-item-content">年龄</div>
                <div class="mdui-list-item-content mdui-text-right"><?php echo $uage; ?>&nbsp;</div>
                <i class="mdui-icon material-icons">&#xe315;</i>
            </div>
            <div class="mdui-divider mdui-m-y-0"></div>
            <div id="setting_sex" class="mdui-list-item mdui-ripple">
                <i class="mdui-list-item-icon mdui-icon material-icons">&#xe91d;</i>
                <div class="mdui-list-item-content">性别</div>
                <div class="mdui-list-item-content mdui-text-right"><?php echo $usex ?>&nbsp;</div>
                <i class="mdui-icon material-icons">&#xe315;</i>
            </div>
            <div class="mdui-divider mdui-m-y-0"></div>
            <div id="setting_tel" class="mdui-list-item mdui-ripple">
                <i class="mdui-list-item-icon mdui-icon material-icons">&#xe8a8;</i>
                <div class="mdui-list-item-content">电话</div>
                <div class="mdui-list-item-content mdui-text-right"><?php echo $utel; ?>&nbsp;</div>
                <i class="mdui-icon material-icons">&#xe315;</i>
            </div>
            <div class="mdui-divider mdui-m-y-0"></div>
            <div class="mdui-list-item mdui-ripple">
                <i class="mdui-list-item-icon mdui-icon material-icons">&#xe8d0;</i>
                <div class="mdui-list-item-content">所属学院</div>
                <div class="mdui-list-item-content mdui-text-right"><?php echo $ucollege; ?>&nbsp;</div>
            </div>
        </div>
    </div>
    <div class="mdui-chip">
        <span class="mdui-chip-title mdui-text-color-theme-accent">安全隐私</span>
    </div>
    <div class="mdui-card mdui-center" style="margin-top: 5px">
        <div class="mdui-list">
            <div id="setting_pwd" class="mdui-list-item mdui-ripple">
                <i class="mdui-list-item-icon mdui-icon material-icons">&#xe897;</i>
                <div class="mdui-list-item-content">登录密码</div>
                <i class="mdui-icon material-icons">&#xe315;</i>
            </div>
            <div class="mdui-divider mdui-m-y-0"></div>
            <div id="setting_pwd" class="mdui-list-item mdui-ripple">
                <i class="mdui-list-item-icon mdui-icon material-icons">&#xe897;</i>
                <div class="mdui-list-item-content">自动登录功能</div>
                <label class="mdui-switch">
                    <input type="checkbox" id="auto_login_switch"/>
                    <i class="mdui-switch-icon"></i>
                </label>
                <div  mdui-tooltip="{content: '更新自动登录有效时间为30天'}" id="reset_auto_login_time" style="padding-left: 18px"><i class="mdui-icon material-icons">&#xe5d5;</i></div>
            </div>
            <?php
            /*
            if ($_SESSION['utype'] != '管理员') {
                echo <<<str
            <div class="mdui-divider mdui-m-y-0"></div>
            <div id="setting_change_type" class="mdui-list-item mdui-ripple">
                <i class="mdui-list-item-icon mdui-icon material-icons">&#xe000;</i>
                <div class="mdui-list-item-content">申请变更用户类型</div>
                <i class="mdui-icon material-icons">&#xe315;</i>
            </div>

str;
            }*/
            ?>
            <!--注销账号功能-->
            <div class="mdui-divider mdui-m-y-0" style="display: none"></div>
            <div id="setting_delete_account" class="mdui-list-item mdui-ripple" style="display: none">
                <i class="mdui-list-item-icon mdui-icon material-icons">&#xe872;</i>
                <div class="mdui-list-item-content">注销账号</div>
                <i class="mdui-icon material-icons">&#xe315;</i>
            </div>
        </div>
    </div>
    <div class="mdui-chip">
        <span class="mdui-chip-title mdui-text-color-theme-accent">个性化</span>
    </div>
    <div class="mdui-card mdui-center" style="margin-top: 5px;">
        <div class="mdui-list">
            <div id="setting_theme" class="mdui-list-item mdui-ripple">
                <i class="mdui-list-item-icon mdui-icon material-icons">&#xe3b7;</i>
                <div class="mdui-list-item-content">主题色<a class="drxs-sub-text">工具栏等配色</a></div>
                <div class="drxs-color mdui-color-theme"></div>
                <i class="mdui-icon material-icons">&#xe315;</i>
            </div>
            <div class="mdui-divider mdui-m-y-0"></div>
            <div id="setting_theme_accent" class="mdui-list-item mdui-ripple">
                <i class="mdui-list-item-icon mdui-icon material-icons">&#xe891;</i>
                <div class="mdui-list-item-content">主题强调色<a class="drxs-sub-text">部分文字、按钮、对话框确认键等配色</a></div>
                <div class="drxs-color mdui-color-theme-accent"></div>
                <i class="mdui-icon material-icons">&#xe315;</i>
            </div>
            <div class="mdui-divider mdui-m-y-0"></div>
            <div id="setting_theme_table" class="mdui-list-item mdui-ripple">
                <i class="mdui-list-item-icon mdui-icon material-icons">&#xe23a;</i>
                <div class="mdui-list-item-content">表格配色</div>
                <div class="drxs-color <?php echo $_SESSION['table_color_1']; ?>"></div>
                <div class="drxs-color <?php echo $_SESSION['table_color_2']; ?>"></div>
                <div class="drxs-color <?php echo $_SESSION['table_color_3']; ?>"></div>
                <i class="mdui-icon material-icons">&#xe315;</i>
            </div>
        </div>
    </div>

    <!--主题色对话框-->
    <div class="mdui-dialog" id="dialog_theme_color">
        <div class="mdui-dialog-title">修改主题色</div>
        <div class="mdui-dialog-content">
            <div class="mdui-row-xs-1 mdui-row-sm-2 mdui-row-md-3">
                <div class="mdui-col">
                    <label class="mdui-radio mdui-m-b-1">
                        <input type="radio" name="setting_theme_color" value="mdui-theme-primary-white">
                        <i class="mdui-radio-icon "></i> 默认-白色 white
                    </label>
                </div>
                <div class="mdui-col">
                    <label class="mdui-radio mdui-m-b-1">
                        <input type="radio" name="setting_theme_color" value="mdui-theme-primary-blue" id="blue">
                        <i class="mdui-radio-icon"></i> <a class="mdui-text-color-blue">蓝色 blue</a>
                    </label>
                </div>
                <div class="mdui-col">
                    <label class="mdui-radio mdui-m-b-1">
                        <input type="radio" name="setting_theme_color" value="mdui-theme-primary-light-blue" id="light">
                        <i class="mdui-radio-icon"></i> <a class="mdui-text-color-light-blue">浅蓝色 light-blue</a>
                    </label>
                </div>
                <div class="mdui-col">
                    <label class="mdui-radio mdui-m-b-1">
                        <input type="radio" name="setting_theme_color" value="mdui-theme-primary-indigo">
                        <i class="mdui-radio-icon"></i><a class="mdui-text-color-indigo">靛蓝色 indigo</a>
                    </label>
                </div>
                <div class="mdui-col">
                    <label class="mdui-radio mdui-m-b-1">
                        <input type="radio" name="setting_theme_color" value="mdui-theme-primary-deep-orange">
                        <i class="mdui-radio-icon"></i> <a class="mdui-text-color-deep-orange">深橙色 deep-orange</a>
                    </label>
                </div>
                <div class="mdui-col">
                    <label class="mdui-radio mdui-m-b-1">
                        <input type="radio" name="setting_theme_color" value="mdui-theme-primary-red">
                        <i class="mdui-radio-icon"></i> <a class="mdui-text-color-red">红色 red</a>
                    </label>
                </div>
                <div class="mdui-col">
                    <label class="mdui-radio mdui-m-b-1">
                        <input type="radio" name="setting_theme_color" value="mdui-theme-primary-purple">
                        <i class="mdui-radio-icon"></i> <a class="mdui-text-color-purple">紫色 purple</a>
                    </label>
                </div>
                <div class="mdui-col">
                    <label class="mdui-radio mdui-m-b-1">
                        <input type="radio" name="setting_theme_color" value="mdui-theme-primary-pink">
                        <i class="mdui-radio-icon"></i> <a class="mdui-text-color-pink">粉色 pink</a>
                    </label>
                </div>
                <div class="mdui-col">
                    <label class="mdui-radio mdui-m-b-1">
                        <input type="radio" name="setting_theme_color" value="mdui-theme-primary-cyan">
                        <i class="mdui-radio-icon"></i> <a class="mdui-text-color-cyan">青色 cyan</a>
                    </label>
                </div>
                <div class="mdui-col">
                    <label class="mdui-radio mdui-m-b-1">
                        <input type="radio" name="setting_theme_color" value="mdui-theme-primary-blue-grey">
                        <i class="mdui-radio-icon"></i> <a class="mdui-text-color-blue-grey">蓝灰色 blue-grey</a>
                    </label>
                </div>
            </div>
        </div>
        <div class="mdui-dialog-actions">
            <button class="mdui-btn mdui-ripple" mdui-dialog-confirm>确认</button>
            <button class="mdui-btn mdui-ripple" mdui-dialog-close>取消</button>
        </div>
    </div>
    <!--主题强调色对话框-->
    <div class="mdui-dialog" id="dialog_theme_accent_color">
        <div class="mdui-dialog-title">修改主题强调色</div>
        <div class="mdui-dialog-content">
            <div class="mdui-row-xs-1 mdui-row-sm-2 mdui-row-md-3">
                <div class="mdui-col">
                    <label class="mdui-radio mdui-m-b-1">
                        <input type="radio" name="setting_theme_accent_color" value="mdui-theme-accent-blue">
                        <i class="mdui-radio-icon"></i> <a class="mdui-text-color-blue">蓝色 blue</a>
                    </label>
                </div>
                <div class="mdui-col">
                    <label class="mdui-radio mdui-m-b-1">
                        <input type="radio" name="setting_theme_accent_color" value="mdui-theme-accent-light-blue">
                        <i class="mdui-radio-icon"></i> <a class="mdui-text-color-light-blue">浅蓝色 light-blue</a>
                    </label>
                </div>
                <div class="mdui-col">
                    <label class="mdui-radio mdui-m-b-1">
                        <input type="radio" name="setting_theme_accent_color" value="mdui-theme-accent-indigo">
                        <i class="mdui-radio-icon"></i><a class="mdui-text-color-indigo">靛蓝色 indigo</a>
                    </label>
                </div>
                <div class="mdui-col">
                    <label class="mdui-radio mdui-m-b-1">
                        <input type="radio" name="setting_theme_accent_color" value="mdui-theme-accent-deep-orange">
                        <i class="mdui-radio-icon"></i> <a class="mdui-text-color-deep-orange">深橙色 deep-orange</a>
                    </label>
                </div>
                <div class="mdui-col">
                    <label class="mdui-radio mdui-m-b-1">
                        <input type="radio" name="setting_theme_accent_color" value="mdui-theme-accent-red">
                        <i class="mdui-radio-icon"></i> <a class="mdui-text-color-red">红色 red</a>
                    </label>
                </div>
                <div class="mdui-col">
                    <label class="mdui-radio mdui-m-b-1">
                        <input type="radio" name="setting_theme_accent_color" value="mdui-theme-accent-purple">
                        <i class="mdui-radio-icon"></i> <a class="mdui-text-color-purple">紫色 purple</a>
                    </label>
                </div>
                <div class="mdui-col">
                    <label class="mdui-radio mdui-m-b-1">
                        <input type="radio" name="setting_theme_accent_color" value="mdui-theme-accent-pink">
                        <i class="mdui-radio-icon"></i> <a class="mdui-text-color-pink">粉色 pink</a>
                    </label>
                </div>
            </div>
        </div>
        <div class="mdui-dialog-actions">
            <button class="mdui-btn mdui-ripple" mdui-dialog-confirm>确认</button>
            <button class="mdui-btn mdui-ripple" mdui-dialog-close>取消</button>
        </div>
    </div>
    <!--表格颜色对话框-->
    <div class="mdui-dialog" id="dialog_theme_table">
        <div class="mdui-dialog-title">修改表格配色</div>
        <div class="mdui-dialog-content">
            <div class="mdui-row-xs-1 mdui-row-sm-2 mdui-row-md-3">
                <div class="mdui-col">
                    <label class="mdui-radio mdui-m-b-1">
                        <input type="radio" name="setting_theme_table" value="setting_theme_table_1">
                        <i class="mdui-radio-icon"></i> <a>默认-配色1 white</a>
                    </label>
                </div>
                <div class="mdui-col">
                    <label class="mdui-radio mdui-m-b-1">
                        <input type="radio" name="setting_theme_table" value="setting_theme_table_2">
                        <i class="mdui-radio-icon"></i><a class="mdui-text-color-blue">配色2 blue-indigo</a>
                    </label>
                </div>
                <div class="mdui-col">
                    <label class="mdui-radio mdui-m-b-1">
                        <input type="radio" name="setting_theme_table" value="setting_theme_table_3">
                        <i class="mdui-radio-icon"></i><a class="mdui-text-color-cyan">配色3 blue-cyan</a>
                    </label>
                </div>
                <div class="mdui-col">
                    <label class="mdui-radio mdui-m-b-1">
                        <input type="radio" name="setting_theme_table" value="setting_theme_table_4">
                        <i class="mdui-radio-icon"></i> <a class="mdui-text-color-red">配色4 red-pink</a>
                    </label>
                </div>
                <div class="mdui-col">
                    <label class="mdui-radio mdui-m-b-1">
                        <input type="radio" name="setting_theme_table" value="setting_theme_table_5">
                        <i class="mdui-radio-icon"></i> <a class="mdui-text-color-light-blue">配色5 cyan-tear</a>
                    </label>
                </div>
                <div class="mdui-col">
                    <label class="mdui-radio mdui-m-b-1">
                        <input type="radio" name="setting_theme_table" value="setting_theme_table_6">
                        <i class="mdui-radio-icon"></i> <a class="mdui-text-color-amber">配色6 amber-lime</a>
                    </label>
                </div>
            </div>
        </div>
        <div class="mdui-dialog-actions">
            <button class="mdui-btn mdui-ripple" mdui-dialog-confirm>确认</button>
            <button class="mdui-btn mdui-ripple" mdui-dialog-close>取消</button>
        </div>
    </div>
</div>


<?php require_once './component/footer.php'; ?>
